package com.sxhuayuan.parking.service;

import java.util.Date;

import com.sxhuayuan.parking.compenent.Page;
import com.sxhuayuan.parking.compenent.Pageable;
import com.sxhuayuan.parking.config.CarActType;
import com.sxhuayuan.parking.entity.ParkingIn;
import com.sxhuayuan.parking.entity.ParkingLot;

public interface ParkingInService extends BaseService<ParkingIn, Long> {

	/**
	 * 车辆入场
	 * 
	 * @param lot
	 * @param carPlate
	 * @param time
	 * @param channelId
	 * @param freeMinutes
	 */
	ParkingIn enter(ParkingLot lot, String carPlate, Date time, Long channelId, Integer freeMinutes, CarActType carActType);
	
	/**
	 * 车辆入场  包含第三方入场编号
	 * @param lot
	 * @param carPlate
	 * @param time
	 * @param channelId
	 * @param freeMinutes
	 * @param lotRecordId
	 * @return
	 */
	ParkingIn enter(ParkingLot lot, String carPlate, Date time, Long channelId, Integer freeMinutes, String lotRecordId, CarActType carActType);
	
	/**
	 * 查询入场记录
	 * @param parkingLotId
	 * @param carPlate
	 * @return
	 */
	ParkingIn findByCarPlate(Long parkingLotId, String carPlate);
	
	/**
	 * 查询入场记录
	 * @param uid
	 * @return
	 */
	ParkingIn findByUniqueId(Long uid);
	
	ParkingIn findByParkingLotIdAndLotRecordId(Long lotId, String recordId);

	/** 分页查询 */
	Page<ParkingIn> findByPage(Pageable pageable);
}
